package com.mryang.hds.mapper;

import com.mryang.hds.entity.TripInfo;
import com.mryang.hds.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.annotation.ManagedBean;
import java.util.List;

/**
 * @author Genius
 * @version 1.0.0
 * @ClassName TripInfoMapper.java
 * @Description TODO
 * @createTime 2023年01月08日 12:19:00
 */
@Mapper
public interface TripInfoMapper {

    int insertTripInfo(@Param("trip") TripInfo trip, @Param("uid") Integer uId);

    List<TripInfo> getTrips(@Param("token") User token);

    void addTrip(@Param("tripInfo") TripInfo tripInfo);

    TripInfo getTripById(@Param("tId") Integer tId);

    void editTrip(@Param("tripInfo") TripInfo tripInfo,@Param("tripOld")  TripInfo tripOld);

    void deleteTrip(@Param("tId") Integer tid);

    List<TripInfo> getTripsByUId(@Param("uid") Integer uid);

    // 删除用户所对应的数据
    void delTripByUId(@Param("userId") Integer userId);
}
